package Com.amit.synchronization;


class Table1
{
	
public synchronized static void printable(int n)
	{

		for(int i=1;i<=5;i++)
		{
			System.out.println(n*i);
			try
			{
				Thread.sleep(500);
			}
			catch (Exception e) {
				
				System.out.println(e);
			}
		}
	}
}
class Mythread11 extends Thread
{
	
   
	@Override
	public void run() {
		
		Table1.printable(1);
		
		
	}
}

class Mythread21 extends Thread
{
	@Override
	public void run() {
	
		Table1.printable(5);
	}
}


class Mythread31 extends Thread
{
	@Override
	public void run() {
	
		Table1.printable(10);
	}
}

class Mythread41 extends Thread
{
	@Override
	public void run() {
	
		Table1.printable(100);
	}
}

public class Lab2 
{

	public static void main(String[] args) {
		
		
		Mythread11 t1=new Mythread11();
		Mythread21 t2=new Mythread21();
		Mythread31 t3=new Mythread31();
		Mythread41 t4=new Mythread41();
		
	
	t1.start();
	t2.start();
	t3.start();
	t4.start();
	}

}
